<%@ page import="com.pijunn.users.AppUser" %>



<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'username', 'error')} required">
	<label for="username">
		<g:message code="appUser.username.label" default="Username" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="username" required="" value="${appUserInstance?.username}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'password', 'error')} required">
	<label for="password">
		<g:message code="appUser.password.label" default="Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="password" name="password" required="" value="${appUserInstance?.password}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'firstName', 'error')} required">
	<label for="firstName">
		<g:message code="appUser.firstName.label" default="First Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="firstName" required="" value="${appUserInstance?.firstName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'lastName', 'error')} required">
	<label for="lastName">
		<g:message code="appUser.lastName.label" default="Last Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="lastName" required="" value="${appUserInstance?.lastName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'contactEMail', 'error')} required">
	<label for="contactEMail">
		<g:message code="appUser.contactEMail.label" default="Contact EMail" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="email" name="contactEMail" required="" value="${appUserInstance?.contactEMail}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'contactCellPhone', 'error')} ">
	<label for="contactCellPhone">
		<g:message code="appUser.contactCellPhone.label" default="Contact Cell Phone" />
		
	</label>
	<g:textField name="contactCellPhone" value="${appUserInstance?.contactCellPhone}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'contactOtherPhone', 'error')} ">
	<label for="contactOtherPhone">
		<g:message code="appUser.contactOtherPhone.label" default="Contact Other Phone" />
		
	</label>
	<g:textField name="contactOtherPhone" value="${appUserInstance?.contactOtherPhone}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'contactSkypeId', 'error')} ">
	<label for="contactSkypeId">
		<g:message code="appUser.contactSkypeId.label" default="Contact Skype Id" />
		
	</label>
	<g:textField name="contactSkypeId" value="${appUserInstance?.contactSkypeId}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'accountExpired', 'error')} ">
	<label for="accountExpired">
		<g:message code="appUser.accountExpired.label" default="Account Expired" />
		
	</label>
	<g:checkBox name="accountExpired" value="${appUserInstance?.accountExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'accountLocked', 'error')} ">
	<label for="accountLocked">
		<g:message code="appUser.accountLocked.label" default="Account Locked" />
		
	</label>
	<g:checkBox name="accountLocked" value="${appUserInstance?.accountLocked}" />
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'enabled', 'error')} ">
	<label for="enabled">
		<g:message code="appUser.enabled.label" default="Enabled" />
		
	</label>
	<g:checkBox name="enabled" value="${appUserInstance?.enabled}" />
</div>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'passwordExpired', 'error')} ">
	<label for="passwordExpired">
		<g:message code="appUser.passwordExpired.label" default="Password Expired" />
		
	</label>
	<g:checkBox name="passwordExpired" value="${appUserInstance?.passwordExpired}" />
</div>

<fieldset class="embedded"><legend><g:message code="appUser.mailingAddress.label" default="Mailing Address" /></legend>
	<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'mailingAddress.address1', 'error')} required">
		<label for="mailingAddress.address1">
			<g:message code="appUser.mailingAddress.address1.label" default="Address1" />
			<span class="required-indicator">*</span>
		</label>
		<g:textField name="mailingAddress.address1" required="" value="${appUserInstance?.mailingAddress?.address1}"/>
	</div>
	
	<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'mailingAddress.address2', 'error')} ">
		<label for="mailingAddress.address2">
			<g:message code="appUser.mailingAddress.address2.label" default="Address2" />
			
		</label>
		<g:textField name="mailingAddress.address2" value="${appUserInstance?.mailingAddress?.address2}"/>
	</div>
									
	<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'mailingAddress.country', 'error')} required">
		<label for="mailingAddress.country">
			<g:message code="appUser.mailingAddress.country.label" default="Country" />
			<span class="required-indicator">*</span>
		</label>
		<g:select name="mailingAddress.country" from="${['US', 'CA']}"
	 			valueMessagePrefix="mailingAddress.country" />
	</div>
	
	<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'mailingAddress.zipCode', 'error')} required">
		<label for="mailingAddress.zipCode">
			<g:message code="appUser.mailingAddress.zipCode.label" default="Zip Code" />
			<span class="required-indicator">*</span>
		</label>
		<g:textField name="mailingAddress.zipCode" pattern="${addressInstance.constraints.zipCode.matches}" required="" value="${appUserInstance?.mailingAddress?.zipCode}"/>
	</div>
	
	<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'mailingAddress.city', 'error')} required">
		<label for="mailingAddress.city">
			<g:message code="appUser.mailingAddress.city.label" default="City" />
			<span class="required-indicator">*</span>
		</label>
		<g:textField name="mailingAddress.city" required="" value="${appUserInstance?.mailingAddress?.city}"/>
	</div>
	
	<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'mailingAddress.state', 'error')} required">
		<label for="mailingAddress.state">
			<g:message code="appUser.mailingAddress.state.label" default="State" />
			<span class="required-indicator">*</span>
		</label>
		<g:textField name="mailingAddress.state" required="" value="${appUserInstance?.mailingAddress?.state}"/>
	</div>
</fieldset>

<div class="fieldcontain ${hasErrors(bean: appUserInstance, field: 'roles', 'error')} ">
	<label for="roles">
		<g:message code="appUser.roles.label" default="Roles" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${appUserInstance?.roles?}" var="r">
    <li><g:link controller="secUserSecRole" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="secUserSecRole" action="create" params="['appUser.id': appUserInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'secUserSecRole.label', default: 'SecUserSecRole')])}</g:link>
</li>
</ul>

</div>

